-include("geometry.hrl").

%%
%% cell: this record is for mnesia table cell
%%
-record(zone, {left::float(), top::float(), right::float(), bottom::float()}).
-type zone() :: #zone{}.

-type image_type() :: string().
-type image_data() :: binary().
-type raster() :: {image_type(), image_data()}.

-record(id_with_node, {node, id}).
-record(vector_tile, {tile_name::string(), features=[] :: [feature()], properties=[] :: [property()]}).
-record(raster_tile, {type::string(), data::binary(), properties=[] :: [property()]}).

-type vector_tile() :: #vector_tile{}.
-type raster_tile() :: #raster_tile{}.

-type cell_id_scope() :: 113..116.  % 48..51.
-type cell_id() :: [cell_id_scope()].   %% [$q | $r | $s | $t]
-record(cell, {
        id :: cell_id(),
        scale_factor :: 0..30, 
        zone :: zone(),
        r_layer :: raster_tile(),
        v_layers=[] :: [vector_tile()]
    }).
-type cell() :: #cell{}.
%%
%% 
%% v_layer_tiles = [#vector_tile{...}, #vector_tile{...}, ...]
%%
-record(cell_tiles, {id, cell_id, v_layer_tiles = [], r_layer_tiles = []}).

-record(layer, {id, name, proj, layer_location::zone()}).
